package com.ruoyi.dynamic.controller.app;


import com.ruoyi.common.core.constant.constant.PathConstant;
import com.ruoyi.common.core.pojo.vo.MultiVO;
import com.ruoyi.common.core.pojo.vo.SingleVO;
import com.ruoyi.common.core.result.Result;
import com.ruoyi.dynamic.model.pojo.entity.RoomType;
import com.ruoyi.dynamic.service.IRoomTypeService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Tag(name = "App-房间类型相关", description = "App-房间类型相关")
@RestController
@RequestMapping(PathConstant.APP_PATH + "room-type")
public class AppRoomTypeController {

    @Autowired
    private IRoomTypeService iRoomTypeService;

    @Operation(summary = "列表", description = "列表")
    @GetMapping("list")
    public MultiVO<RoomType> list() {
        return Result.multi(iRoomTypeService.lambdaQuery().orderByAsc(RoomType::getId).list());
    }


    @Operation(summary = "详情", description = "详情")
    @GetMapping("info")
    public SingleVO<RoomType> info(Long id) {
        return Result.single(iRoomTypeService.getById(id));
    }


}

